-- Table: public.candle

-- DROP TABLE IF EXISTS public.candle;

CREATE TABLE IF NOT EXISTS public.candle
(
    open real NOT NULL,
    high real NOT NULL,
    low real NOT NULL,
    close real NOT NULL,
    volume integer NOT NULL,
    id integer NOT NULL,
    isin character varying(12) COLLATE pg_catalog."default" NOT NULL,
    "time" timestamp without time zone NOT NULL,
    complete boolean NOT NULL,
    ticker character varying(5) COLLATE pg_catalog."default" NOT NULL,
    CONSTRAINT candle_id_const UNIQUE (id)
        INCLUDE(id)
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.candle
    OWNER to postgres;

GRANT ALL ON TABLE public.candle TO loader;

GRANT ALL ON TABLE public.candle TO postgres;

COMMENT ON TABLE public.candle
    IS 'Свечи по разным инструментам за разные периоды.';
-- Index: candle_idx

-- DROP INDEX IF EXISTS public.candle_idx;

CREATE UNIQUE INDEX IF NOT EXISTS candle_idx
    ON public.candle USING btree
    (id ASC NULLS LAST)
    TABLESPACE pg_default;